package top.purity.server.user.domain;

import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Comment;
import top.purity.framework.orm.BaseTenantDO;

/**
 * @Author lmh
 * @Description
 * @CreateTime 2023-09-25 15:26
 */


@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "user_role_menu",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"role_id", "menu_id", "tenant_id"})
        }, indexes = {
        @Index(name = "idx_ri", columnList = "role_id"),
        @Index(name = "idx_mi", columnList = "menu_id"),
        @Index(name = "idx_ti", columnList = "tenant_id")
})
public class RoleMenu extends BaseTenantDO {
    @Column(name = "role_id", nullable = false)
    @Comment("角色id")
    private Long roleId;

    @Column(name = "menu_id", nullable = false)
    @Comment("菜单id")
    private Long menuId;

}
